In [1]:
!pwd
In [2]:
%load_ext ipycache
In [3]:
from bigram_tagging import testing_viterbi
testing_viterbi()
Everything seems to go Ok!
In [4]:
from bigram_tagging import train
In [5]:
%%cache model.pkl start_f, trans_f, emit_f, obs_states
start_f, trans_f, emit_f, obs_states = train("de-train.tt")
In [6]:
from bigram_tagging import evaluate_model, add_one_smoothing
In [7]:
%%cache test_corpus.pkl sents, t_sents
sents, t_sents = evaluate_model("de-test.t", start_f, trans_f, emit_f, obs_states, add_one_smoothing)
In [8]:
from bigram_tagging import write_corpus
In [9]:
write_corpus("de-test.tt", sents, t_sents)
Now, try the evaluation script
In [10]:
!python eval.py de-test.tt de-eval.tt
In [ ]: